home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / Virtual User 1.0b5 / Virtual User / MPW Scripts / MultiCpp_vu < prev    next >
Encoding:
Text File  |  1990-10-05  |  2.6 KB  |  93 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        multiVUfront
  3. #
  4. #    Contains:    This script can be used to create the command line for executing 
  5. #                VU, interactively (via Commando) for multiple targets/scripts.
  6. #                The important thing about this script is that it preprocesses the
  7. #                script files using the C preprocessor(so as to facilitate the use of 
  8. #                '#include "filename"' directives in the script). The preprocessed output
  9. #                (which is generated by "C -e script.vu" command) is saved in a file
  10. #                whose name is same as the script file, with an additional extension '.cpp'
  11. #                These preprocessed files are the ones used as script files in the commandline
  12. #                generated. 
  13. #    Output:        This script will generate two different command lines. First, to be used
  14. #                for executing the preprocessed VU script files. Second, to be used to 
  15. #                delete the preprocessed files created by this script, after the execution of
  16. #                the VU scripts are done.
  17. #
  18. #    Note:        Since the VU tool is going to execute the preprocessed files, errors
  19. #                reported, if any, will indicate line numbers corresponding to this file,
  20. #                which will be different from those in your original VU script files.
  21. #
  22. #    Prerequisite: This script makes use of the script called 'cpp_vu'. You should have that
  23. #                script to be able to run this one.
  24. #
  25. #    Written by:    P Nagarajan
  26. #
  27. #    Copyright:    © 1989 by Apple Computer, Inc., all rights reserved.
  28. #
  29. #    Change History:
  30. #
  31. #         6/5/89       naga        creation 
  32. #
  33. #    To Do:
  34. #
  35. set exit 0
  36. set newcommand 'VU '
  37. set deletefiles 'Delete -p '
  38. set total_targets "`request "how many targets do you plan to run against?"`"
  39. exit 1 if {total_targets} > 12
  40. exit 1 if {total_targets} < 1
  41. set target_num 1
  42. loop
  43.     Break if {target_num} > {total_targets}
  44.     set str "`commando VU`"
  45.     set skip 1
  46.     for item in {str}
  47.         if {skip}
  48.             set skip 0
  49.             continue
  50.         end
  51.         if {script_found}
  52.             set result "`cpp_vu "{item}"`"
  53.             set newcommand "{newcommand} ∂'{result}∂'"
  54.             set deletefiles "{deletefiles} ∂'{result}∂'"
  55.             set script_found 0
  56.             continue
  57.         end #if script name
  58.         if "{item}" =~ /-(≈)®1/ 
  59.             if "{item}" == "-s" 
  60.                 set script_found 1
  61.             end #if '-s'
  62.             set newcommand "{newcommand} -{®1}{target_num}"
  63.         else
  64.             set newcommand "{newcommand} ∂'{item}∂'"
  65.         end #if
  66.     end #for
  67.     evaluate target_num = {target_num} + 1
  68. end #loop
  69. set skip 1
  70. set arg_seen 0
  71. for item in {newcommand}
  72.     if {skip}
  73.         echo -n "{item}"
  74.         set skip 0
  75.         continue
  76.     end
  77.     if "{item}" =~ /-(≈)/ 
  78.         if {arg_seen}
  79.             echo -n " ∂∂∂n"
  80.             set delta 1
  81.         end
  82.         echo -n "∂t{item}"
  83.         set arg_seen 1
  84.     else
  85.         set arg_seen 0
  86.         echo -n "∂t∂'{item}∂' ∂∂∂n"
  87.         set delta 1
  88.     end #if
  89. end #for
  90. if {delta} 
  91.     replace \∂∂\  '' "{active}"
  92. end
  93. echo "{deletefiles}"